﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="descriptin.aspx.vb" Inherits="project.descriptin" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajax:ToolkitScriptManager>

    <asp:GridView ID="GridView1" runat="server" DataSourceID="wineID" 
    AutoGenerateColumns="False" DataKeyNames="ID">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" Visible="False" 
                ReadOnly="True" SortExpression="ID" />
          

          <asp:BoundField DataField="Brands" HeaderText="Brands" 
                SortExpression="Brands" />
            <asp:BoundField DataField="colour" HeaderText="colour" Visible="false"
                SortExpression="colour" />
            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            <asp:BoundField DataField="ingredients" HeaderText="ingredients" />
            
            <asp:BoundField DataField="price" HeaderText="price" 
                SortExpression="price" />
            
                <asp:TemplateField HeaderText="Picture">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("photo") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
               <%-- <asp:HyperLink ID="HyperLink1" NavigateUrl='<%# Eval("ID","descriptin.aspx?ID={0}") %>' runat="server">--%>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("photo") %>' CssClass="imgsize" Width="400" />
                    <%--</asp:HyperLink>--%>
                </ItemTemplate>
                  </asp:TemplateField>
            <asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
            
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="wineID" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    
        SelectCommand="SELECT [ID], [colour], [ingredients], [price], [photo], [description], [Brands], [Name] FROM [wined] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="ID" QueryStringField="ID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    <b>Rate the Wine</b>
    <br />
    <ajax:Rating ID="Rating1" runat="server" BorderStyle="Solid" BorderWidth="1px" CurrentRating="0"
                                            EmptyStarCssClass="emptyRatingStar" FilledStarCssClass="filledRatingStar" Height="40px"
                                            StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" Width="200px"
                                            OnChanged="RatingChanged" AutoPostBack="true">
                                        </ajax:Rating>

    <br />
    The Current Rating of this is &nbsp; <asp:Label ID="lbRating" runat="server" Font-Bold="true"></asp:Label>
    <br />
    <br />
    <b>People thought this wine was</b>
    <asp:BulletedList ID ="BLTag" runat ="server" DataSourceID="SqlDataSource3" 
        DataTextField="Tag" DataValueField="Tag">
    </asp:BulletedList>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Tag], [ID] FROM [winetagview] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />

    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="Name" HeaderText="Name" 
                SortExpression="Name" />
            <asp:BoundField DataField="Tag" HeaderText="Tag" SortExpression="Tag" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Name], [Tag] FROM [winetagview]">
    </asp:SqlDataSource>

    <br />
    <asp:TextBox ID="txtTag" runat="server"></asp:TextBox>
    <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="Tag" DataValueField="ID" 
        RepeatDirection="Horizontal">
    </asp:CheckBoxList>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ID], [Tag] FROM [tags]">
    </asp:SqlDataSource>
    <br />
    <asp:Button ID="Button2" runat="server" Text="Tag" />
    <br />
    <br />
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        DataSourceID="commentsdatabase" Height="134px" Width="283px">
        <Columns>
        <asp:TemplateField HeaderText="Comments">
         <ItemTemplate>   
         <div style="background-color:Gray ">
            <%# Eval("subject") %><br />
            <b><%# Eval("Author") %></b><br />
            <%# Eval("Message") %><br />
         </div>
         
         </ItemTemplate><AlternatingItemTemplate>
          <div style="background-color:white ">
           <%# Eval("subject") %><br />
            <b><%# Eval("Author") %></b><br />
            <%# Eval("Message") %><br />
         </div>
         </AlternatingItemTemplate>
         </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="commentsdatabase" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [Author], [subject], [Message] FROM [comments] WHERE ([wined] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="wined" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
   
    <br />
    ADD COMMENTS<br />
    <br />
    Author<br />
    <asp:TextBox ID="f1" runat="server" Width="295px"></asp:TextBox>
    <br />
    <br />
    subject<br />
    <asp:TextBox ID="f2" runat="server" Width="296px"></asp:TextBox>
    <br />
    <br />
    message<br />
    <asp:TextBox ID="f3" runat="server" Height="102px" Width="296px"></asp:TextBox>

    <br />
    <br />
<asp:Button ID="Button1" runat="server" Text="Button" Width="80px" />
</asp:Content>